home *** CD-ROM | disk | FTP | other *** search
- ELF_STRPTR(3E) Last changed: 10-13-98
-
-
- NNAAMMEE
- eellff__ssttrrppttrr - Makes a string pointer
-
- SSYYNNOOPPSSIISS
- cccc [_f_l_a_g ...] _f_i_l_e ... --lleellff [_l_i_b_r_a_r_y ...]
-
- ##iinncclluuddee <<lliibbeellff..hh>>
-
- cchhaarr **eellff__ssttrrppttrr((EEllff **eellff,, ssiizzee__tt sseeccttiioonn,, ssiizzee__tt ooffffsseett));;
-
- ##ddeeffiinnee __LLIIBBEELLFF__XXTTNNDD__6644
-
- cchhaarr **eellff__ssttrrppttrr((EEllff **eellff,, EEllff6644__XXwwoorrdd sseeccttiioonn,, EEllff6644__XXwwoorrdd ssiizzee__tt
- ooffffsseett));;
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- This function converts a string section ooffffsseett to a string pointer.
- eellff identifies the file in which the string section resides, and
- sseeccttiioonn gives the section table index for the strings. eellff__ssttrrppttrr
- normally returns a pointer to a string. If eellff is null, sseeccttiioonn is
- invalid or is not a section of type SSHHTT__SSTTRRTTAABB, the section data
- cannot be obtained, ooffffsseett is invalid, or an error occurs, it returns
- a null pointer.
-
- NNOOTTEESS
- A program may call eellff__ggeettddaattaa to retrieve an entire string table
- section. For some applications, that would be both more efficient and
- more convenient than using eellff__ssttrrppttrr.
-
- The use of a ssiizzee__tt in a 32-bit compile with eellff__ssttrrppttrr is
- unfortunate, since that makes it impossible to deal with certain
- object files. If, when the 32-bit app is compiled, __LLIIBBEELLFF__XXTTNNDD__6644 is
- defined, then the function interface changes to have 64-bit fields.
- If __LLIIBBEELLFF__XXTTNNDD__6644 is defined at compile-time, then instead of linking
- with --lleellff, link with --lleellff__xxttnndd. There is a corresponding
- --llddwwaarrff__xxttnndd. It is essential that a 32-bit application compiled with
- __LLIIBBEELLFF__XXTTNNDD__6644 be entirely compiled with __LLIIBBEELLFF__XXTTNNDD__6644 defined.
-
- Applications that are built as 64-bit applications can ignore
- __LLIIBBEELLFF__XXTTNNDD__6644: it has no effect on them and 64-bit applications
- always link with --lleellff, never with --lleellff__xxttnndd.
-
- EEXXAAMMPPLLEESS
- The following is a prototype for retrieving section names. The file
- header specifies the section name string table in the ee__sshhssttrrnnddxx
- member. The following code loops through the sections, printing their
- names.
-
- if ((ehdr = elf32_getehdr(elf)) == 0)
- {
- /* handle the error */
- return;
- }
- ndx = ehdr->e_shstrndx;
- scn = 0;
- while ((scn = elf_nextscn(elf, scn)) != 0)
- {
- char *name = 0;
- if ((shdr = elf32_getshdr(scn)) != 0)
- name = elf_strptr(elf, ndx, (size_t)shdr->sh_name);
- printf("'%s'\n", name? name: "(null)");
- }
-
- SSEEEE AALLSSOO
- eellff(3E), eellff__ggeettddaattaa(3E), eellff__ggeettsshhddrr(3E), eellff__xxllaattee(3E)
-
- This man page is available only online.
-
-